/**********************************************
这是代码自动生成的，如果重新生成，所做的改动将会丢失
系统:gpssolution
模块:系统平台
Itop.com 版权所有
生成者：Rabbit
生成时间:2012-8-1 10:14:11
***********************************************/

using System;
using System.Threading;
using System.ComponentModel;
namespace Itop.GpsCar.Model
{
    /// <summary>
    ///[action]业务实体类
    ///对应表名:action
    /// </summary>
    [Serializable]
    public class action
    {
        
        #region Private 成员
        private long _idaction=0; 
        private int _device_id=0; 
        private int _action_type=0; 
        private string _action_paras=String.Empty; 
        private DateTime _issue_datetime=new DateTime(1900,1,1); 
        private DateTime _complete_datetime=new DateTime(1900,1,1); 
        private DateTime _expire_time=new DateTime(1900,1,1); 
        private int _status=0; 
        private DateTime _timestamp=new DateTime(1900,1,1); 
        private string _description=String.Empty; 
        private string _reserved_1=String.Empty; 
        private string _reserved_2=String.Empty;   
        #endregion
  
  
        #region Public 成员
   
        /// <summary>
        /// 属性名称：idAction
        /// 属性描述：
        /// 字段信息：[idAction],BIGINT UNSIGNED
        /// </summary>
        [Browsable(false)]
        [DisplayNameAttribute("")]
        public long idAction
        {
            get { return _idaction; }
            set
            {			
                if (_idaction as object == null || !_idaction.Equals(value))
                {
                    _idaction = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：device_id
        /// 属性描述：Id of device that associated with this event
        /// 字段信息：[device_id],INT
        /// </summary>
        [DisplayNameAttribute("Id of device that associated with this event")]
        public int device_id
        {
            get { return _device_id; }
            set
            {			
                if (_device_id as object == null || !_device_id.Equals(value))
                {
                    _device_id = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：action_type
        /// 属性描述：1 - update server list; 2 - update allow number; 3 - lock car; 4 -update APN; 5 - update software; 6 - reboot
        /// 字段信息：[action_type],INT
        /// </summary>
        [DisplayNameAttribute("1 - update server list; 2 - update allow number; 3 - lock car; 4 -update APN; 5 - update software; 6 - reboot")]
        public int action_type
        {
            get { return _action_type; }
            set
            {			
                if (_action_type as object == null || !_action_type.Equals(value))
                {
                    _action_type = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：action_paras
        /// 属性描述：default is empty now
        /// 字段信息：[action_paras],VARCHAR
        /// </summary>
        [DisplayNameAttribute("default is empty now")]
        public string action_paras
        {
            get { return _action_paras; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[default is empty now]长度不能大于45!");
                if (_action_paras as object == null || !_action_paras.Equals(value))
                {
                    _action_paras = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：issue_datetime
        /// 属性描述：The time of this action has been issued, this is the time that server decided an action required for a client device and generate this action for client.
        /// 字段信息：[issue_datetime],DATETIME
        /// </summary>
        [DisplayNameAttribute("The time of this action has been issued")]
        public DateTime issue_datetime
        {
            get { return _issue_datetime; }
            set
            {			
                if (_issue_datetime as object == null || !_issue_datetime.Equals(value))
                {
                    _issue_datetime = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：complete_datetime
        /// 属性描述：The time the client finish this action.
        /// 字段信息：[complete_datetime],DATETIME
        /// </summary>
        [DisplayNameAttribute("The time the client finish this action.")]
        public DateTime complete_datetime
        {
            get { return _complete_datetime; }
            set
            {			
                if (_complete_datetime as object == null || !_complete_datetime.Equals(value))
                {
                    _complete_datetime = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：expire_time
        /// 属性描述：If action not exist yet, then just insert. If action already exist, then we need check expire time in order to determine if we need insert new action event or not.
        /// 字段信息：[expire_time],DATETIME
        /// </summary>
        [DisplayNameAttribute("If action not exist yet")]
        public DateTime expire_time
        {
            get { return _expire_time; }
            set
            {			
                if (_expire_time as object == null || !_expire_time.Equals(value))
                {
                    _expire_time = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：status
        /// 属性描述：0 - pending, 1 - reply successfully, 2- reply failed
        /// 字段信息：[status],INT
        /// </summary>
        [DisplayNameAttribute("0 - pending")]
        public int status
        {
            get { return _status; }
            set
            {			
                if (_status as object == null || !_status.Equals(value))
                {
                    _status = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：timestamp
        /// 属性描述：
        /// 字段信息：[timestamp],TIMESTAMP
        /// </summary>
        [DisplayNameAttribute("")]
        public DateTime timestamp
        {
            get { return _timestamp; }
            set
            {			
                if (_timestamp as object == null || !_timestamp.Equals(value))
                {
                    _timestamp = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：description
        /// 属性描述：
        /// 字段信息：[description],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string description
        {
            get { return _description; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_description as object == null || !_description.Equals(value))
                {
                    _description = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：reserved_1
        /// 属性描述：
        /// 字段信息：[reserved_1],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string reserved_1
        {
            get { return _reserved_1; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_reserved_1 as object == null || !_reserved_1.Equals(value))
                {
                    _reserved_1 = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：reserved_2
        /// 属性描述：
        /// 字段信息：[reserved_2],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string reserved_2
        {
            get { return _reserved_2; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_reserved_2 as object == null || !_reserved_2.Equals(value))
                {
                    _reserved_2 = value;
                }
            }			 
        }
  
        #endregion 
  
        #region 方法
        public static string Newid(){
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }
        public string CreateID(){
            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }
        #endregion		
    }	
}
